<template>
    <div class='app-container'>
        <div class='layout'>
            <div class='balance'>
            账户余额：
            </div>
            <div class='inputbox'>
                <span>时间：</span>
                 <el-date-picker  v-model="getTime"  type="datetimerange"  range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size='mini' @change='timeChange'>
                </el-date-picker>
                <el-input v-model="data.keyWord" placeholder="请输入操作人/用户信息" class='wd230' size='mini'></el-input>
                <el-button size="mini" type='primary' class="icon iconfont icon-sousuo searchDate" @click='search()'>搜索</el-button>
            </div>
            <div class='util-table'>
                <el-table :data="tableData" stripe style="width:100%">
                    <el-table-column prop="creationTime" label="操作时间" width="250"></el-table-column>
                    <el-table-column prop="formUserName" label="操作人" width="190"></el-table-column>
                    <el-table-column label="转出/转入" width="190">
                        <template slot-scope='scope'>
                            <div v-if='scope.row.operationType==3'>转出</div>
                            <div v-if='scope.row.operationType==2'>转入</div>
                            <div v-if='scope.row.operationType==1'>提现</div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="money" label="金额(元)" width="180"></el-table-column>
                    <el-table-column prop="date" label="对方用户信息">
                        <template slot-scope='scope'>
                            {{scope.row.toUserName }}({{scope.row.toUserPhone }})
                            <div>{{scope.row.toUserBankCard}}</div>
                        </template>
                    </el-table-column>
                </el-table>
            </div> 
            <div class='page-right'>
                 <el-pagination @current-change="handleCurrentChange" :current-page='currentPage' background :page-size="10" layout="total,prev, pager, next" :total="pageDate.total">
                 </el-pagination>
            </div>
        </div>
       
    </div>
</template>
<script>
    export default{
        data(){
            return{
                getTime:[],
                data:{},
                keyWord:'',
                currentPage:1,
                pageDate:{},
                tableData:[],
            }
        },
        created(){
            this.tablelist(),
            this.accountBalance()
        },
        methods:{
            tablelist(pageindex){
                let params=this.data
                params.pageIndex=pageindex
                this.post(params,'services/app/applets/GetBillListToAdmin').then(rs=>{
                    console.log(rs);
                    this.pageDate.total=rs.result.totalCount
                    this.tableData=rs.result.items
                    if(pageindex){
                        this.currentPage=pageIndex
                    }else{
                        this.currentPage=1
                    }
                })
            },
            handleCurrentChange(val){
                this.tablelist(val)
            },
            accountBalance(){
                let params={}
                this.post(params,'services/app/applets/GetTenantDetail').then(rs=>{
                    console.log(rs)
                })
            },
            search(){
                this.tablelist()
            },
            timeChange(){
                this.data.beginDate=this.getTime[0]
                this.data.endDate=this.getTime[1]
            },
        }
    }

</script>
<style scoped rel='stylesheet/scss' lang='scss'>
    .layout{
        margin: 20px 20px 0 20px;
        .inputbox{
            margin-top: 35px;
            .searchDate{
                margin-left: 15px;
            }
        }
        .page-right{
            text-align: right;
            margin-top: 52px;
            margin-bottom: 20px;
        }
    }

</style>
